//
//  ViewController.m
//  AlertController
//
//  Created by 郑信鸿 on 16/7/16.
//  Copyright © 2016年 郑信鸿. All rights reserved.
//

#import "ViewController.h"
#import "AlertMananger.h"
#import "UpLoadUserpicTool.h"

@interface ViewController ()
- (IBAction)getHeadImage:(id)sender;
@property (weak, nonatomic) IBOutlet UIImageView *headImage;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];
    AlertMananger *alert = [[AlertMananger shareManager] creatAlertWithTitle:@"提示" message:@"测试信息" preferredStyle:UIAlertControllerStyleAlert cancelTitle:@"取消" otherTitle:@"确定",@"第二个", nil];
    [alert showWithViewController:self IndexBlock:^(NSInteger index) {
        NSLog(@"%ld",index);
    }];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)getHeadImage:(id)sender {
     __weak typeof(self) weakSelf = self;
    [[UpLoadUserpicTool shareManager]selectUserpicSourceWithViewController:weakSelf FinishSelectImageBlcok:^(UIImage *image) {
       
        self.headImage.image = image;
        
    }];
    
}
@end
